local class = require "Core.middleclass"
local LuaBehaviour = class("LuaBehaviour")
function LuaBehaviour:GetSerialized()
    local defineList = {}
    local tbl = self
    if(tbl.__instanceDict == nil)then
        return defineList
    end
    for k,v in pairs(tbl.__instanceDict) do
        if(LuaBehaviour[k]==nil and class[k] == nil and type(v) ~= "function" and v ~= nil) then
            defineList[k] = typeof(v)
        end
    end
    return defineList
end

local AssistantDict = {
    ["Update"] = typeof(CS.LuaUpdateAssistant),
    ["FixedUpdate"] = typeof(CS.LuaFixedUpdateAssistant),
    ["LateUpdate"] = typeof(CS.LuaLateUpdateAssistant),
    ["OnPointerClick"] = typeof(CS.LuaOnPointerClickAssistant)
}
function LuaBehaviour:initialize()
    for funcName, assistant in pairs(AssistantDict) do
        if self[funcName] then
            self.gameObject:AddComponent(assistant)
        end
    end
end

return LuaBehaviour
